const moment = require('moment');
module.exports=(sequelize,type)=>{
  return sequelize.define('project',{
    id: {
      type: type.INTEGER,
      primaryKey: true,
      allowNull: true,
      autoIncrement: true,
    },
    uuid:{
      type: type.STRING(37),
    },
    title:{
      type:type.STRING(25)
    },
    link:{
      type:type.STRING(100)
    },
    content: {
      type: type.TEXT,
      // allowNull: false,
    },
    level: {
      type: type.INTEGER,
      // allowNull: false,
    },
    createdAt: {
      type: type.DATE,
      get() {
        return moment(this.getDataValue('createdAt')).format('YYYY-MM-DD HH:mm:ss');
      }
    },
    updatedAt: {
      type: type.DATE,
      get() {
        return moment(this.getDataValue('updatedAt')).format('YYYY-MM-DD HH:mm:ss');
      }
    }
  },{
    // freezeTableName: true
  })
}